Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the handling of public and private GitHub repositories when uploading them to the system. The main enhancement is allowing public repositories to be cloned without requiring a GitHub token, while ensuring that private repositories still require authentication. The code has been updated to check repository visibility before enforcing token requirements, and error messages have been clarified.
Repository authentication and visibility handling:
get_github_tokenfunction inrepository.pyto allowNoneas a valid return value for public repositories, removing the requirement for a token if the repository is public.is_repository_publicutility before cloning: if the repository is private and no token is provided, an error is raised. This ensures tokens are only required for private repositories. [1] [2]is_repository_publicasync function togithub_utils.py, which checks repository visibility by making an unauthenticated request to the GitHub API.API and model improvements:
UploadRepositoryRequestmodel to clarify that thegithub_tokenis only required for private repositories and is optional for public repositories.Internal codebase adjustments:
repository_service.pyandgit_repository.pyto accept an optional GitHub token (str | None), and to only inject the token into the clone URL if one is provided. [1] [2] [3]